import request from '@/utils/request'

const Api = {
  getCaptcha:'/captcha',
  getMyToken:'/system-auth/oauth/token',

  getCarGeoJsonCache: '/cyc-postgis/api.cyc.pg/v1/location/inCache/points/geojson',
  getCarPointsCache: '/cyc-postgis/api.cyc.pg/v1/location/inCache/points',
  getCarCountCache: '/cyc-postgis/api.cyc.pg/v1/vehicleAnalysis/inCache/summaryLast5m',
  getCarCountsummaryLast5m: '/cyc-postgis/api.cyc.pg/v1/vehicleAnalysis/summaryLast5m',
  getCarLastHourCountCache: '/cyc-postgis/api.cyc.pg/v1/vehicleAnalysis/inCache/summaryLastHour',
  getCarDayCountCache: '/cyc-postgis/api.cyc.pg/v1/vehicleAnalysis/inCache/summaryToday',
  getCarDayCountsummaryToday: '/cyc-postgis/api.cyc.pg/v1/vehicleAnalysis/summaryToday',
  getCarLast24HDensity: '/cyc-postgis/api.cyc.pg/v1/vehicleAnalysis/summaryInLast24H',
  getCarDensityByDate: '/cyc-postgis/api.cyc.pg/v1/vehicleAnalysis/summaryOneDay',
  getCarDensityByTime: '/cyc-postgis/api.cyc.pg/v1/vehicleAnalysis/summaryOneHour',
  getCarOBDCountCache: '/cyc-obd-admin/cyc.obd.admin/v1/dashboard/online',
  getCarDischargeByToday : '/cyc-emission-cal/api.cyc.em/v1/emission/summaryByCountyToday',
  getCarDischargeLast5m : '/cyc-emission-cal/api.cyc.em/v1/emission/summaryLast5m',
  getCarDischargeLastHour : '/cyc-emission-cal/api.cyc.em/v1/emission/summaryLastHour',
  getCarDischargeLastWeek : '/cyc-emission-cal/api.cyc.em/v1/emission/summaryLastWeek',
  getCarDayCountInDays:'/cyc-postgis/api.cyc.pg/v1/vehicleAnalysis/summaryInDays',
  getCarBaseInfo: '/cyc-vehicleInfo/api.cyc.baseInfo/v1/vehicleInfo',
  getCarState: '/cyc-bigData-server/api.cyc.bigData/v1/location/last/position',
  getCarImage: '/cyc-postgis/api.cyc.pg/v1/vehiclePosition/portrait',
  getCarImageFromTo: '/cyc-postgis/api.cyc.pg/v1/vehiclePosition/position',
  getCarCityPoints: '/cyc-postgis/api.cyc.pg/v1/vehiclePosition/stop/station',
  getCarLog: '/cyc-telemetering/cyc.telemetering/v1/checkResult',
  getCarObd: '/cyc-obd-admin/cyc.obd.admin/v1/location/vehicleStatus',
  getCarHistoryLocus: '/cyc-bigData-server/api.cyc.bigData/v1/location/geojson/lines',
  getCarTotalLocus: '/cyc-postgis/api.cyc.pg/v1/vehiclePosition/history/tracks',
  getRegionAlert: '/cyc-postgis/api.cyc.pg/v1/alarm/region',
  getVehicleAlert: '/cyc-postgis/api.cyc.pg/v1/alarm/vehicle',
  getCarGreyListGeo: '/cyc-postgis/api.cyc.pg/v1/location/greyList/inCache/points/geojson',
  getOBDPointsGeo: '/cyc-obd-admin/cyc.obd.admin/v1/device/online/latest/location/geojson/point',
  getCarHistoryPointsGeo: '/cyc-bigData-server/api.cyc.bigData/v1/location/geojson/point',
  getSummaryLastMouth:'/cyc-emission-cal/api.cyc.em/v1/emission/summaryLastMouth',
  getSummaryThisYear:'/cyc-emission-cal/api.cyc.em/v1/emission/summaryThisYear',
  getRegionAnalysis:'/cyc-postgis/api.cyc.pg/v1/regionAnalysis/regions',
  getRegionDict:'/cyc-postgis/api.cyc.pg/v1/dict/dict',
  getRegionAnalysisInTime:'/cyc-postgis/api.cyc.pg/v1/regionAnalysis/regions/inTime',
  getOneRegionSumTotal:'/cyc-emission-cal/api.cyc.em/v1/region/statistic/oneRegion/sumTotal',
  getOneRegionSumTotalByTime:'/cyc-emission-cal/api.cyc.em/v1/region/statistic/oneRegion/sumTotalByTime',
  getAllRegionSumTotal:'/cyc-emission-cal/api.cyc.em/v1/region/statistic/allRegions/sumTotal',
  getPfInTime:'/cyc-postgis/api.cyc.pg/v1/regionAnalysis/oneRegion/vehicleNum/Pf/inTime',
  getVehicleNumInTime:'/cyc-postgis/api.cyc.pg/v1/regionAnalysis/oneRegion/vehicleNum/inTime',
  getVehicleNumTonInTime:'/cyc-postgis/api.cyc.pg/v1/regionAnalysis/oneRegion/vehicleNum/ton/inTime',
  getMjVehicleLocationOnline:'/vehicle-mj/monitor/mj-vehicle-location/online',
  getBenchmarkBased:'/cyc-postgis/api.cyc.pg/v1/regionAnalysis/regions/based',
  getDynamicRegionAnalysisRegion:'/cyc-postgis/api.cyc.pg/v1/dynamicRegionAnalysis/region',
  getDynamicRegionAnalysisRegionId:'/cyc-postgis/api.cyc.pg/v1/dynamicRegionAnalysis',
  getAlarmRecordOnline:'/vehicle-mj/monitor/alarm-record/online',
  getMjEnterpriseInfoList:'/vehicle-mj/api.mj.monitor/v1/monitor/mj-enterprise-info/list',
  getMjEnterpriseInfo:'/vehicle-mj/api.mj.monitor/v1/monitor/mj-enterprise-info',
  getMjVehicleLocationPage:'/vehicle-mj/monitor/mj-vehicle-location/page',
  getAlarmOnline:'/cyc-telemetering/cyc.telemetering/v1/alarm/online',
  getYcCheckSite:'/cyc-telemetering/cyc.telemetering/v1/checkSite',
  getYcCheckResult:'/cyc-telemetering/cyc.telemetering/v1/checkResult/oneSite',
  getMjLeftAnalysis:'/vehicle-mj/api.mj.monitor/v1/monitor/analysis',
  getYcLeftAnalysis:'/cyc-telemetering/cyc.telemetering/v1/analysis',
  getHourRoadCount:'/cyc-postgis/api.cyc.pg/v1/vehicleRoad/selectRoadVehicleCount',
  // getHourRoadCount:'/vue-admin-template/user/selectRoadVehicleCount',


}

export function getHourRoadCount(pars = {}) {
  return request({
    url: Api.getHourRoadCount,
    method: 'get',
    params: pars
  })
}

// 获取验证码
export function getCaptcha() {
  return request({
    url: Api.getCaptcha,
    method: 'get'
  })
}

// 请求token
export function getMyToken(pars = {}) {
  return request({
    url: Api.getMyToken,
    headers: {
      'Authorization': 'Basic c3lzdGVtLWFkbWluLXdlYjoxMjM0NTY='
    },
    method: 'post',
    params: pars
  })
}
// 登出
export function logout() {
  return request({
    url: '/system-auth/oauth/logout',
    method: 'post'
  })
}

// 实时车辆位置点-inCache
export function getCarPointsCache(pars = {}) {
  return request({
    url: Api.getCarPointsCache,
    headers: {},
    method: 'get',
    params: pars
  })
}

// 实时车辆点位-GEOJSON-InCache
export function getCarGeoJsonCache(pars = {}) {
  return request({
    url: Api.getCarGeoJsonCache,
    headers: {},
    method: 'get',
    params: pars
  })
}
// 统计实时车辆数据-inCache
export function getCarCountCache(pars = {}) {
  return request({
    url: Api.getCarCountCache,
    headers: {},
    method: 'get',
    params: pars
  })
}
// 统计上一小时车辆数据-inCache
export function getCarLastHourCountCache(pars = {}) {
  return request({
    url: Api.getCarLastHourCountCache,
    headers: {},
    method: 'get',
    params: pars
  })
}
// 统计当天车辆当日-inCache
export function getCarDayCountCache(pars = {}) {
  return request({
    url: Api.getCarDayCountCache,
    headers: {},
    method: 'get',
    params: pars
  })
}
// 统计实时车辆数据
export function getCarCountsummaryLast5m(pars = {}) {
  return request({
    url: Api.getCarCountsummaryLast5m,
    headers: {},
    method: 'get',
    params: pars
  })
}
// 统计当天车辆当日-inCache
export function getCarDayCountsummaryToday(pars = {}) {
  return request({
    url: Api.getCarDayCountsummaryToday,
    headers: {},
    method: 'get',
    params: pars
  })
}

// 统计某段时间内日车辆数
export function getCarDayCountInDays(pars = {}) {
  return request({
    url: Api.getCarDayCountInDays,
    headers: {},
    method: 'get',
    params: pars
  })
}

// 近24小时车辆及车辆密度
export function getCarLast24HDensity(pars = {}) {
  return request({
    url: Api.getCarLast24HDensity,
    headers: {},
    method: 'get',
    params: pars
  })
}
// 统计历史车辆数据-某天
export function getCarDensityByDate(pars = {}) {
  return request({
    url: Api.getCarDensityByDate,
    headers: {},
    method: 'get',
    params: pars
  })
}
// 统计历史车辆数据-某小时
export function getCarDensityByTime(pars = {}) {
  return request({
    url: Api.getCarDensityByTime,
    headers: {},
    method: 'get',
    params: pars
  })
}

// OBD车辆统计查询接口
export function getCarOBDCountCache(pars = {}){
  return request({
    url: Api.getCarOBDCountCache,
    headers: {},
    method: 'get',
    params: pars
  })
}

// 车辆基本信息查询
export function getCarBaseInfo(pars = {}){
  return request({
    url: Api.getCarBaseInfo,
    headers: {},
    method: 'get',
    params: pars
  })
}

//实时排放量汇总
export function getCarDischargeLast5m(pars = {}){
  return request({
    url: Api.getCarDischargeLast5m,
    headers: {},
    method: 'get',
    params: pars
  })
}

//上一小时排放量汇总(千克)
export function getCarDischargeLastHour(pars = {}){
  return request({
    url: Api.getCarDischargeLastHour,
    headers: {},
    method: 'get',
    params: pars
  })
}

//上一周排放量汇总(吨)
export function getCarDischargeLastWeek(pars = {}){
  return request({
    url: Api.getCarDischargeLastWeek,
    headers: {},
    method: 'get',
    params: pars
  })
}
//当天分区县排放量汇总(吨)
export function getCarDischargeByToday(pars = {}){
  return request({
    url: Api.getCarDischargeByToday,
    headers: {},
    method: 'get',
    params: pars
  })
}
//区域告警
export function getRegionAlert(pars = {}){
  return request({
    url: Api.getRegionAlert,
    headers: {},
    method: 'get',
    params: pars
  })
}
//车辆告警
export function getVehicleAlert(pars = {}){
  return request({
    url: Api.getVehicleAlert,
    headers: {},
    method: 'get',
    params: pars
  })
}


// 车辆实时信息
export function getCarState(pars = {}){
  return request({
    url: Api.getCarState,
    headers: {},
    method: 'get',
    params: pars
  })
}

// 获取行为画像
export function getCarImage(pars = {}){
  return request({
    url: Api.getCarImage,
    headers: {},
    method: 'get',
    params: pars
  })
}

// 获取往返路线
export function getCarImageFromTo(pars = {}){
  return request({
    url: Api.getCarImageFromTo,
    headers: {},
    method: 'get',
    params: pars
  })
}
// 获取市内停靠点
export function getCarCityPoints(pars = {}){
  return request({
    url: Api.getCarCityPoints,
    headers: {},
    method: 'get',
    params: pars
  })
}
// 获取遥感遥测数据
export function getCarLog(pars = {}){
  return request({
    url: Api.getCarLog,
    headers: {},
    method: 'get',
    params: pars
  })
}
// 获取OBD单车实时数据
export function getCarObd(pars = {}){
  return request({
    url: Api.getCarObd,
    headers: {},
    method: 'get',
    params: pars
  })
}
// 获取车辆历史轨迹geo
export function getCarHistoryLocus(pars = {}){
  return request({
    url: Api.getCarHistoryLocus,
    headers: {},
    method: 'get',
    params: pars
  })
}
// 获取车辆长跑轨迹geo
export function getCarTotalLocus(pars = {}){
  return request({
    url: Api.getCarTotalLocus,
    headers: {},
    method: 'get',
    params: pars
  })
}
// 获取灰名单实时点位geo
export function getCarGreyList(pars = {}) {
  return request({
    url: Api.getCarGreyListGeo,
    headers: {},
    method: 'get',
    params: pars
  })
}
// 获取OBD点位Geo
export function getOBDPointsGeo(pars = {}) {
  return request({
    url: Api.getOBDPointsGeo,
    headers: {},
    method: 'get',
    params: pars
  })
}
// 根据时间获取车辆的轨迹点
export function getCarHistoryPointsGeo(pars = {}) {
  return request({
    url: Api.getCarHistoryPointsGeo,
    headers: {},
    method: 'get',
    params: pars
  })
}
//获取上一月排放量汇总(吨)
export function  getSummaryLastMouth(pars = {}) {
  return request({
    url: Api.getSummaryLastMouth,
    headers: {},
    method: 'get',
    params: pars
  })
}
//获取当年排放量汇总(吨)
export function  getSummaryThisYear(pars = {}) {
  return request({
    url: Api.getSummaryThisYear,
    headers: {},
    method: 'get',
    params: pars
  })
}
// 区域对比
export function  getRegionAnalysis(pars = {}) {
  return request({
    url: Api.getRegionAnalysis,
    headers: {},
    method: 'get',
    params: pars
  })
}//基准分析
export function  getBenchmarkBased(pars = {}) {
  return request({
    url: Api.getBenchmarkBased,
    headers: {},
    method: 'get',
    params: pars
  })
}
// 字典-区域
export function  getRegionDict(pars = {}) {
  return request({
    url: Api.getRegionDict,
    headers: {},
    method: 'get',
    params: pars
  })
}
// 区域趋势对比
export function getRegionAnalysisInTime(pars = {}) {
  return request({
    url: Api.getRegionAnalysisInTime,
    headers: {},
    method: 'get',
    params: pars
  })
}

// 某区域排放量汇总
export function getOneRegionSumTotal(pars = {}) {
  return request({
    url: Api.getOneRegionSumTotal,
    headers: {},
    method: 'get',
    params: pars
  })
}
// 某区域排放量统计-按时间
export function getOneRegionSumTotalByTime(pars = {}) {
  return request({
    url: Api.getOneRegionSumTotalByTime,
    headers: {},
    method: 'get',
    params: pars
  })
}
// 当日所有区域排放量汇总
export function getAllRegionSumTotal(pars = {}) {
  return request({
    url: Api.getAllRegionSumTotal,
    headers: {},
    method: 'get',
    params: pars
  })
}

// 某区域按排放阶段统计车辆数
export function getPfInTime(pars = {}) {
  return request({
    url: Api.getPfInTime,
    headers: {},
    method: 'get',
    params: pars
  })
}

// 某区域某段时间车流量
export function getVehicleNumInTime(pars = {}) {
  return request({
    url: Api.getVehicleNumInTime,
    headers: {},
    method: 'get',
    params: pars
  })
}

// 某区域按总重统计车辆数
export function getVehicleNumTonInTime(pars = {}) {
  return request({
    url: Api.getVehicleNumTonInTime,
    headers: {},
    method: 'get',
    params: pars
  })
}
// 根据区县查询站点信息
export function getYcCheckSite(pars = {}) {
  return request({
    url: Api.getYcCheckSite,
    headers: {},
    method: 'get',
    params: pars
  })
}

// 动态区域
export function getDynamicRegionAnalysisRegion(pars = {}) {
  return request({
    url: Api.getDynamicRegionAnalysisRegion,
    headers: {},
    method: 'post',
    data: pars
  })
}
//保存区域
export function getDynamicRegionAnalysisRegionId(pars = {}) {
  return request({
    url: Api.getDynamicRegionAnalysisRegionId + '/' + pars.regionId,
    headers: {},
    method: 'post',
    data: pars
  })
}


// 企业门禁实时车辆记录
export function getMjVehicleLocationOnline(pars = {}) {
  return request({
    url: Api.getMjVehicleLocationOnline,
    headers: {},
    method: 'get',
    params: pars
  })
}
// 企业门禁告警信息
export function getAlarmRecordOnline(pars = {}) {
  return request({
    url: Api.getAlarmRecordOnline,
    headers: {},
    method: 'get',
    params: pars
  })
}
// 企业门禁列表
export function getMjEnterpriseInfoList(pars = {}) {
  return request({
    url: Api.getMjEnterpriseInfoList,
    headers: {},
    method: 'get',
    params: pars
  })
}
// 企业门禁获取企业基本信息
export function getMjEnterpriseInfo(pars = {}) {
  return request({
    url: Api.getMjEnterpriseInfo + '/' + pars.enterpriseName,
    headers: {},
    method: 'get',
    params: pars
  })
}

// 企业门禁车辆分页记录
export function getMjVehicleLocationPage(pars = {}) {
  return request({
    url: Api.getMjVehicleLocationPage,
    headers: {},
    method: 'get',
    params: pars
  })
}

// 遥测门站告警信息
export function getAlarmOnline(pars = {}) {
  return request({
    url: Api.getAlarmOnline,
    headers: {},
    method: 'get',
    params: pars
  })
}

// 遥测门站弹窗列表信息
export function getYcCheckResult(pars = {}) {
  return request({
    url: Api.getYcCheckResult,
    headers: {},
    method: 'get',
    params: pars
  })
}

//企业门禁左侧收缩框信息
export function getMjLeftAnalysis(pars = {}) {
  return request({
    url: Api.getMjLeftAnalysis,
    headers: {},
    method: 'get',
    params: pars
  })
}

//遥测门站左侧收缩框信息
export function getYcLeftAnalysis(pars = {}) {
  return request({
    url: Api.getYcLeftAnalysis,
    headers: {},
    method: 'get',
    params: pars
  })
}







